package ljt.music.bean;

import android.support.annotation.NonNull;

/**
 * @author jiangtao
 * @date 2017/12/22
 */
public class Tabs implements Comparable<Tabs> {

    private Long id;
    private String name;
    private int isEnable;
    private int position;

    public Tabs(Long id, String name, int isEnable, int position) {
        this.id = id;
        this.name = name;
        this.isEnable = isEnable;
        this.position = position;
    }

    public Tabs() {
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIsEnable() {
        return this.isEnable;
    }

    public void setIsEnable(int isEnable) {
        this.isEnable = isEnable;
    }

    public int getPosition() {
        return this.position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        Tabs bean = (Tabs) o;

        if (isEnable != bean.isEnable)
            return false;
        if (position != bean.position)
            return false;
        if (id != null ? !id.equals(bean.id) : bean.id != null)
            return false;
        return name != null ? name.equals(bean.name) : bean.name == null;

    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + isEnable;
        result = 31 * result + position;
        return result;
    }

    @Override
    public int compareTo(@NonNull Tabs o) {
        return this.position - o.getPosition();
    }

    @Override
    public String toString() {
        return "Tabs{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", isEnable=" + isEnable +
                ", position=" + position +
                '}';
    }
}
